From: Platonides Date: Tue, 15 Mar 2011 22:22:57 +0000 (+0000) Subject: (Bug 28069) MediaWiki fails streaming files when mod_deflate and ob_gzhandler are... X-Git-Tag: 1.31.0-rc.0~31379 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=36781c5b4ca7059457fd7f536f655cbb07df5139;p=lhc%2Fweb%2Fwiklou.git (Bug 28069) MediaWiki fails streaming files when mod_deflate and ob_gzhandler are also set gzipped content with header: "Content-Encoding: , gzip" --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index bdb18b8496..e07b5e14ba 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1599,7 +1599,13 @@ function wfResetOutputBuffers( $resetGzipEncoding = true ) { if( $status['name'] == 'ob_gzhandler' ) { // Reset the 'Content-Encoding' field set by this handler // so we can start fresh. - header( 'Content-Encoding:' ); + if ( function_exists( 'header_remove' ) ) { + // Available since PHP 5.3.0 + header_remove( 'Content-Encoding' ); + } else { + // We need to provide a valid content-coding. See bug 28069 + header( 'Content-Encoding: identity' ); + } break; } }